<template>
	<view class="project-list" @click="toDetail(info.id)">
		<view class="project-item fx-center-between">
			<view class="project-left">
				<view class=" fx-center">
					<view class="project-name">{{info.name}}</view>
					<image src="/static/baozhang.png" mode="aspectFill" class="baozhang-icon" v-if="info.pl_safety">
					</image>
					<view class="name-tag" v-if="info.is_new">新</view>
				</view>
				<view class="fx-center">
					<view class="main-tag-item main-tag-color2" v-if="info.fee_mode===1">{{info.fee_mode_name}}</view>
					<view class="main-tag-item main-tag-color3" v-else>{{info.fee_mode_name}}</view>
					<view class="main-tag-item main-tag-color1" v-for="tag in info.tags" :key="tag.id">{{tag.name}}
					</view>
					<!-- <van-tag color="rgba(1, 183, 108, 0.1)" text-color="#01B76C" size="mini" v-if="info.fee_mode===1">
						{{info.fee_mode_name}}
					</van-tag>
					<van-tag color="rgba(137, 73, 245, 0.1)" text-color="#8949F5" size="mini" v-else>
						{{info.fee_mode_name}}
					</van-tag>
					<van-tag size="mini" v-for="tag in info.tags" :key="tag" color="#F6F6F6" text-color="#5C5F66"
						style="margin-left: 8rpx;">{{tag.name}}</van-tag> -->
				</view>
				<view class="project-desc">{{info.summary}}</view>
			</view>
			<image :src="info.cover_url" mode="aspectFill" class="project-img"></image>
		</view>
		<view class="fx-center-between profit-box">
			<view class="profit-number">
				预计收益 {{info.est_min_earn}}-{{info.est_max_earn}}/月 <text>{{info.actual_man}}人想合作</text>
			</view>
			<van-button color="#4078E5" size="small" custom-style="width:120rpx;height:48rpx"
				v-if="info.state===null">申请</van-button>
			<van-button color="#4078E5" size="small" custom-style="width:120rpx;height:48rpx;padding:0" disabled
				v-else>{{info.state===0 || info.state===1 ? '学习中' : info.state===2 ? '审核中' : info.state===3 ? '合作中' : info.state===4?'重新考核'  : ''}}</van-button>
			<!-- <view class="status-type" v-else>
				{{info.state===0 || info.state===1 ? '学习中' : info.state===2 ? '考核审核中' : info.state===3 ? '合作中' : info.state===4?'重新考核'  : ''}}
			</view> -->
		</view>
	</view>
</template>

<script>
	export default {
		name: "project-item",
		props: {
			info: {
				typeof: Object,
				default: {}
			}
		},
		data() {
			return {

			};
		},
		methods: {
			toDetail(id) {
				uni.navigateTo({
					url: '/pages/index/projectDetail/projectDetail?id=' + id
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.project-list {
		background-color: #fff;
		padding: 32rpx;
		border-radius: 4rpx;

		.project-item {
			height: 136rpx;

			.project-left {
				width: 450rpx;
				height: 158rpx;
				display: flex;
				flex-direction: column;
				justify-content: space-between;

				.project-name {
					font-size: 34rpx;
					font-weight: bold;
					color: #161616;
					min-width: 0;
					text-overflow: ellipsis;
					overflow: hidden;
					white-space: nowrap;
				}

				.baozhang-icon {
					width: 40rpx;
					height: 40rpx;
					margin-left: 8rpx;
					flex-shrink: 0;
				}

				.name-tag {
					width: 40rpx;
					height: 40rpx;
					text-align: center;
					line-height: 40rpx;
					margin-left: 8rpx;
					font-size: 22rpx;
					font-weight: bold;
					color: #FF3B51;
					background: linear-gradient(270deg, rgba(255, 59, 81, 0.1) 0%, rgba(255, 59, 81, 0.1) 100%);
					flex-shrink: 0;
				}

				.project-desc {
					min-width: 0;
					text-overflow: ellipsis;
					overflow: hidden;
					white-space: nowrap;
					color: #161616;
					font-size: 26rpx;
				}
			}


			.project-img {
				width: 136rpx;
				height: 136rpx;
				margin-left: 36rpx;
				flex-shrink: 0;
				border-radius: 4rpx;
			}
		}

		.profit-box {
			background: linear-gradient(270deg, rgba(246, 246, 246, 0) 24%, #F6F6F6 100%);
			border-radius: 4rpx;
			padding: 8rpx 0 8rpx 24rpx;
			font-size: 26rpx;
			margin-top: 26rpx;

			.profit-number {
				font-weight: bold;
				color: #161616;

				text {
					color: #8A8F99;
					margin-left: 16rpx;
					font-weight: normal;
				}
			}

			.status-type {
				color: #4078E5;
				font-size: 24rpx;
				font-weight: bold;
			}
		}
	}
</style>